home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / CENT11.QM < prev    next >
Text File  |  1991-07-18  |  10KB  |  223 lines

  1. *                            CENT11.QM,  v1.1a                   July 18, 1991
  2. *           Macros to Center Lines, Paragraphs and Documents
  3. *                       Written by Tom Hogshead
  4. *       With Macro Contributions by John Goodman and Kyle Watkins
  5. * ┌───────────────────────────[ (INDEX) ]─────────────────────────────────────┐
  6. * │
  7. * │ @(1) Centers line, moves to next line                                 |chg
  8. * │ @(2) Centers paragraph, moves to next paragraph                       |chg
  9. * │ @(6) Centers entire document (Written by John Goodman)                |chg
  10. * │ @(5) Center Current Line or Lines Delineated by Any Block             |new
  11. * │     (Written by John Goodman)
  12. * │ @(8) Center Line(s) Delineated by Any Block (or Current Line          |new
  13. * │      if No Blocks Marked) within User-Prompted Right Margin
  14. * │     (Does not Reset QEdit Right Margin Setting)
  15. * │     (Written by John Goodman)
  16. * │ @(4) Centers line after typing (Written by Kyle Watkins, SemWare)
  17. * │     (same as greyenter, except for use with NON-enhanced keyboards)
  18. * │ (greyenter)  Centers line after typing (Kyle Watkins, SemWare)
  19. * │             (for use with enhanced keyboards only)
  20. * │
  21. * └────────[ be sure to leave at least one blank line at end of Index ]──────┘
  22.  
  23. * Version History:
  24. *
  25. * 1.0a -added greyenter to center line after typing, from Kyle Watkins,
  26. *       SemWare, for use with enahanced keyboards only.
  27. * 1.0b -added @4 to center line after typing, from Kyle Watkins,
  28. *       SemWare, for use with NON-enhanced keyboard.
  29. * 1.0c -Change file name CENTER10 to CENT11.
  30. * 1.0d -Changed documentation
  31. * 1.0e -Changed documentation
  32. * 1.0f -Changed documentation and added START.BAT.
  33. *      -Changed CENTER file names to CENT.
  34. * 1.1  -Removed @3, replaced with @6 (J Goodman) which does the same
  35. *       thing but much faster and smoother.
  36. *      -Added @5 to Center Current Line or Lines Delineated by Any
  37. *       Block (J Goodman)
  38. *      -Modified @1/2/6 per John Goodman
  39. *      -Added @8 to center lines with user prompted right margin,
  40. *       Written by John Goodman.
  41. * 1.1a -Minor documentation changes
  42.  
  43. * For other macros, see ALLMACRO.INF. For macros to remove centering
  44. * by deleteing leading space in front of lines, blocks and paragraghs
  45. * see DELSPxx.QM.
  46.  
  47. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  48. *
  49. * To BEGIN, just type "START CENT" <Enter>. All pertinent files will be
  50. * loaded in the "Ring" for viewing, and CENT11.MAC is read.
  51. * Alternatively, type "START CENT 0" <Enter> and the disk copies of all
  52. * files in the "Ring" will be loaded ready for editing, saving time.
  53.  
  54. * 
  55. * -------------------------
  56. * @(1) Center Current Line
  57. * -------------------------
  58. * This macro centers the line in which the cursor is currently
  59. * positioned and moves to the next line.
  60. *
  61. @1  MacroBegin
  62.     UnmarkBlock         * Make sure no column or multi-line blocks
  63.     CenterLine          * Center current line only
  64.     CursorDown          * Move to next line to do again
  65. *
  66. * 6 bytes Sat  08-25-1990  12:13:33
  67. * 7 bytes Wed  05-15-1991  10:29:43 (JG/TH)
  68.  
  69.  
  70. * 
  71. * ------------------------------
  72. * @(2) Center Current Paragraph
  73. * ------------------------------
  74. * This macro centers the lines in the paragraph in which the
  75. * cursor is currently positioned (or the previous paragraph
  76. * if the cursor is on a blank line) and moves to the next
  77. * paragraph.
  78. *
  79. @2  MacroBegin
  80.     UnmarkBlock          * Ensure no blocks marked
  81.     CursorDown PrevPara  * Move to 1st line of current para
  82.     MarkLine             * Start line block
  83.     NextPara             * Move to 1st line of next para
  84.     CursorUp             * Move up one line
  85.     CenterLine           * Center lines in current para
  86.     UnmarkBlock          * Remove block
  87.     CursorDown           * Move to next para
  88.     MakeCtrofScreen      * Align better on screen
  89. *
  90. * 18 bytes Sat  08-25-1990  12:13:44
  91. * 14 bytes Wed  05-15-1991  10:36:51 (JG/TH)
  92.  
  93. * 
  94. * ----------------------------------------------------------------------
  95. * @(4) Center line after typing, from Kyle Watkins, Semware
  96. * ----------------------------------------------------------------------
  97. *
  98. * In case you do not have an enhanced keyboard, you may want to use
  99. * the following macro instead of greyenter at the end:
  100. *
  101. @4  macrobegin centerline endline return
  102. *
  103. * 7 bytes Sun  08-26-1990  03:08:09
  104.  
  105. * 
  106. * -------------------------------------------------------------
  107. * @(5) Center Line(s) Delineated by Any Block (or Current Line
  108. *      if No Blocks Marked), John Goodman, author
  109. * -------------------------------------------------------------
  110. * This macro centers all lines bound by block begin and end
  111. * positions.  Any type of block (character, line, or column) may
  112. * be used to delineate the line(s) and only one block marker need
  113. * be set.  If no block markers are set, the current line is
  114. * centered.  The cursor will be placed on the line following the
  115. * last one centered so that the macro can be invoked repeatedly
  116. * to center a series of lines.
  117. *
  118. @5 MacroBegin
  119.     CursorRight           * Needed for single-line blocks
  120.     GotoBlockEnd          * Try going to block end, retain pos.
  121.  JTrue BLK:               * Determine if a completed block
  122.     DropAnchor            * If not, DropAnchor will finish it
  123.                           * or mark current line if none started
  124.     GotoBlockEnd          * Go to block end to retain position
  125.  BLK:
  126.     GotoBlockBeg          * Start at the 1st line
  127.     MarkLine              * Mark first line
  128.     PrevPosition          * Return to where block ended
  129.     CenterLine            * Center the Blocked Lines
  130.     UnmarkBlock           * Unmark the block
  131.     CursorDown            * Goto Next Line to Do Again
  132.     BegLine
  133. *
  134. * 17 bytes Fri  04-19-1991  17:23:18
  135. * 18 bytes Wed  05-15-1991  11:03:25 (JG)
  136.  
  137.  
  138. * 
  139. *-------------------------------------------------
  140. * @(6) Center Entire Document
  141. *      (Written by Tom Hogshead and John Goodman
  142. *-------------------------------------------------
  143. * This macro centers every line in the file currently being edited.
  144. *
  145. @6  MacroBegin
  146.     UnmarkBlock       * Ensure No Blocks Marked
  147.     EndFile           * Goto End of File
  148.     MarkLine          * Start Line Block
  149.     BegFile           * Goto Begin of File
  150.     CenterLine        * Center All Blocked Lines
  151.     UnmarkBlock       * Clean Up
  152. *
  153. * 11 bytes Fri  04-19-1991  17:34:59
  154. * 10 bytes Wed  05-15-1991  11:30:04 (JG/TH)
  155.  
  156. * 
  157. * -------------------------------------------------------------
  158. * @(8) Center Line(s) Delineated by Any Block (or Current Line
  159. *      if No Blocks Marked) within User-Prompted Right Margin
  160. *      (Does not Reset QEdit Right Margin Setting)
  161. *      (Written by John Goodman)
  162. * -------------------------------------------------------------
  163. * This macro centers lines between column 1 and a right margin
  164. * entered by the user at the "Goto column" prompt.  Lines that are
  165. * longer than the column number entered by the user will be shifted
  166. * all the way to the left.  Any type of block (character, line, or
  167. * column) may be used to delineate the line(s) and only one block
  168. * marker need be set. If no block markers are set, the current line
  169. * is centered.  The cursor will be placed on the line following the
  170. * last one centered so that the macro can be invoked repeatedly to
  171. * center a series of lines.  This macro does not reset the QEdit
  172. * right margin setting normally used to center or wordwrap lines.
  173. *
  174. @8  MacroBegin
  175.     CursorRight   * Needed for single line block
  176.     GotoBlockEnd  * Try going to block end, retain pos.
  177.  JTrue BLK:       * Determine if a completed block
  178.     DropAnchor    * If not, DropAnchor will finish it
  179.                   * or mark current line if none started
  180.     GotoBlockEnd  * Go to block end to retain position
  181.     MarkLine      * Mark first line
  182.  BLK:             * Line block now set
  183.     BegLine       * Go to begin of last line
  184.     GotoBlockBeg  * Go straight up to 1st line of block
  185.     MarkColumn    * Start column block
  186.     PrevPosition  * Return to last line of block
  187.     BegLine       * Make sure we're in col 1
  188.     GotoColumn    * Prompt user for right margin
  189.       Pause Return
  190.     CenterLine    * Centerline will now del leading spaces
  191.     UnmarkBlock   * Unmark the block
  192.     BegLine       * Go to begin of last line
  193.     CursorDown    * Move to next line to do again!
  194. *
  195. * 24 bytes Tue  06-25-1991  18:55:41 (JG)
  196.  
  197. * 
  198. * ----------------------------------------------------------------------
  199. * (GreyEnter) Center line after typing, from Kyle Watkins, Semware
  200. * ----------------------------------------------------------------------
  201. *
  202. *     You can use the Centerline command, to center the current line
  203. * (based on your right margin setting) -- or use line blocking to mark a
  204. * range of lines -- then issue the Centerline command to center the
  205. * individual lines of the marked line block.
  206. *     If you have an enhanced keyboard, and you have QEdit using the
  207. * enhanced keyboard, you may want to try the following macro:
  208.   
  209. greyenter   macrobegin centerline endline return
  210. *
  211. * 7 bytes Sat  08-25-1990  17:32:31 (size added by TH)
  212.  
  213. * Now when you type your text, then press the Grey Enter Key (Far right
  214. * hand side of your keyboard), your text will be centered as the cursor
  215. * moves to the next line.
  216. *     This will keep your regular Enter key, to be used as normal --
  217. * Please note that if you DO NOT have an enhanced (101 key) keyboard, with
  218. * QEdit recognizing it as such -- then the Grey Enter and regular Enter,
  219. * are treated as the same key.
  220. *     Hope that helps.
  221. *                              --... ...--
  222. * .......Kyle Watkins (SemWare Technical Support)
  223.